Ignore received packets that weren't sent during examine_flow#13203
Conversation
4ed775f to
d372ee4
Compare
There was a problem hiding this comment.
This will miss the failure case - when there is a received packet drop and also a sent packet drop. We may not care if sent packets are not captured in pcap. But any drop in received packet should be reported.
Do not fail immediately upon noticing a received packet drop. We want to measure all received packet drops before concluding a failed state.
There was a problem hiding this comment.
For the branch highlighted here, it handles the case where a received packet was present but no corresponding send packet in which case it logs it out, takes note of the received but not sent packet and carries on processing.
Further below, in the try-except while-loop it determines if packet IDs were missed for both send and receive from the pcaps and if so tracks them and continues processing.
Once all packets have been processed, if there were any that were missed from both send and received then these are logged out as a failure and the test will fail.
Attempts to process received packets that weren't sent resulted in a KeyError exception in the examine_flow disruption calculation. This commit ignores them and handles the case where there are missing packet ID's in the stream.
d372ee4 to
ba3b2b4
Compare
|
The pre-commit check detected issues in the files touched by this pull request. Detailed pre-commit check results: To run the pre-commit checks locally, you can follow below steps:
|
We were initializing to 0 i.e. the first packet had been received before we've even checked for it. This meant a scenario where the first packet i.e. one with packet ID 0 was absent would be missed from the both send and receive packet absent list.
ba3b2b4 to
5056c12
Compare
| prev_payload = None | ||
| if packets: | ||
| prev_payload, prev_time = 0, 0 | ||
| prev_payload, prev_time = -1, 0 |
There was a problem hiding this comment.
There was a problem where if the packet with packet id 0 (i.e. the first packet) was absent, it wouldn't be included in the analysis below. Changed to a non-packet ID by default to resolve this.
Addresses PR comments.
|
@Ryangwaite do we need to cherry pick to 202311 and 202405? |
@StormLiangMS Yes please |
…net#13203) What is the motivation for this PR? The platform_tests.test_advanced_reboot.test_fast_reboot test was failing due to received packets that weren't sent. How did you do it? How did you verify/test it? Modified the examine_flow function to run independently then tested the logic with a series of pcap files with various missing packets in the sequence. The cases included: 100 packets, happy path 100 packets, 0th packet receive missing 100 packets, 0th packet send missing 100 packets, 10th packet both missing, 11th packet both missing 100 packets, 10th packet both missing, 11th packet receive missing 100 packets, 10th packet both missing, 11th packet send missing 100 packets, 10th packet both missing 100 packets, 10th packet receive missing, 11th packet receive missing 100 packets, 10th packet receive missing, 11th packet send missing 100 packets, 10th packet receive missing 100 packets, 10th packet send missing, 11th packet receive missing 100 packets, 10th packet send missing, 11th packet send missing 100 packets, 10th packet send missing 100 packets, bunch of sad cases all in one: pkt-10 both missing pkt-15 send missing pkt-20 receive missing pkt-25 both missing, pkt-26 both missing pkt-30 both missing, pkt-31 send missing pkt-35 both missing, pkt-36 receive missing pkt-45 receive missing, pkt-46 receive missing pkt-55 receive missing, pkt-56 send missing pkt-65 send missing, pkt-66 send missing pkt-75 send missing, pkt-76 receive missing 100 packets, first 10 packets missing Any platform specific information?
|
Cherry-pick PR to 202311: #14323 |
…net#13203) What is the motivation for this PR? The platform_tests.test_advanced_reboot.test_fast_reboot test was failing due to received packets that weren't sent. How did you do it? How did you verify/test it? Modified the examine_flow function to run independently then tested the logic with a series of pcap files with various missing packets in the sequence. The cases included: 100 packets, happy path 100 packets, 0th packet receive missing 100 packets, 0th packet send missing 100 packets, 10th packet both missing, 11th packet both missing 100 packets, 10th packet both missing, 11th packet receive missing 100 packets, 10th packet both missing, 11th packet send missing 100 packets, 10th packet both missing 100 packets, 10th packet receive missing, 11th packet receive missing 100 packets, 10th packet receive missing, 11th packet send missing 100 packets, 10th packet receive missing 100 packets, 10th packet send missing, 11th packet receive missing 100 packets, 10th packet send missing, 11th packet send missing 100 packets, 10th packet send missing 100 packets, bunch of sad cases all in one: pkt-10 both missing pkt-15 send missing pkt-20 receive missing pkt-25 both missing, pkt-26 both missing pkt-30 both missing, pkt-31 send missing pkt-35 both missing, pkt-36 receive missing pkt-45 receive missing, pkt-46 receive missing pkt-55 receive missing, pkt-56 send missing pkt-65 send missing, pkt-66 send missing pkt-75 send missing, pkt-76 receive missing 100 packets, first 10 packets missing Any platform specific information?
|
Cherry-pick PR to 202405: #14324 |
What is the motivation for this PR? The platform_tests.test_advanced_reboot.test_fast_reboot test was failing due to received packets that weren't sent. How did you do it? How did you verify/test it? Modified the examine_flow function to run independently then tested the logic with a series of pcap files with various missing packets in the sequence. The cases included: 100 packets, happy path 100 packets, 0th packet receive missing 100 packets, 0th packet send missing 100 packets, 10th packet both missing, 11th packet both missing 100 packets, 10th packet both missing, 11th packet receive missing 100 packets, 10th packet both missing, 11th packet send missing 100 packets, 10th packet both missing 100 packets, 10th packet receive missing, 11th packet receive missing 100 packets, 10th packet receive missing, 11th packet send missing 100 packets, 10th packet receive missing 100 packets, 10th packet send missing, 11th packet receive missing 100 packets, 10th packet send missing, 11th packet send missing 100 packets, 10th packet send missing 100 packets, bunch of sad cases all in one: pkt-10 both missing pkt-15 send missing pkt-20 receive missing pkt-25 both missing, pkt-26 both missing pkt-30 both missing, pkt-31 send missing pkt-35 both missing, pkt-36 receive missing pkt-45 receive missing, pkt-46 receive missing pkt-55 receive missing, pkt-56 send missing pkt-65 send missing, pkt-66 send missing pkt-75 send missing, pkt-76 receive missing 100 packets, first 10 packets missing Any platform specific information?
What is the motivation for this PR? The platform_tests.test_advanced_reboot.test_fast_reboot test was failing due to received packets that weren't sent. How did you do it? How did you verify/test it? Modified the examine_flow function to run independently then tested the logic with a series of pcap files with various missing packets in the sequence. The cases included: 100 packets, happy path 100 packets, 0th packet receive missing 100 packets, 0th packet send missing 100 packets, 10th packet both missing, 11th packet both missing 100 packets, 10th packet both missing, 11th packet receive missing 100 packets, 10th packet both missing, 11th packet send missing 100 packets, 10th packet both missing 100 packets, 10th packet receive missing, 11th packet receive missing 100 packets, 10th packet receive missing, 11th packet send missing 100 packets, 10th packet receive missing 100 packets, 10th packet send missing, 11th packet receive missing 100 packets, 10th packet send missing, 11th packet send missing 100 packets, 10th packet send missing 100 packets, bunch of sad cases all in one: pkt-10 both missing pkt-15 send missing pkt-20 receive missing pkt-25 both missing, pkt-26 both missing pkt-30 both missing, pkt-31 send missing pkt-35 both missing, pkt-36 receive missing pkt-45 receive missing, pkt-46 receive missing pkt-55 receive missing, pkt-56 send missing pkt-65 send missing, pkt-66 send missing pkt-75 send missing, pkt-76 receive missing 100 packets, first 10 packets missing Any platform specific information?
…net#13203) What is the motivation for this PR? The platform_tests.test_advanced_reboot.test_fast_reboot test was failing due to received packets that weren't sent. How did you do it? How did you verify/test it? Modified the examine_flow function to run independently then tested the logic with a series of pcap files with various missing packets in the sequence. The cases included: 100 packets, happy path 100 packets, 0th packet receive missing 100 packets, 0th packet send missing 100 packets, 10th packet both missing, 11th packet both missing 100 packets, 10th packet both missing, 11th packet receive missing 100 packets, 10th packet both missing, 11th packet send missing 100 packets, 10th packet both missing 100 packets, 10th packet receive missing, 11th packet receive missing 100 packets, 10th packet receive missing, 11th packet send missing 100 packets, 10th packet receive missing 100 packets, 10th packet send missing, 11th packet receive missing 100 packets, 10th packet send missing, 11th packet send missing 100 packets, 10th packet send missing 100 packets, bunch of sad cases all in one: pkt-10 both missing pkt-15 send missing pkt-20 receive missing pkt-25 both missing, pkt-26 both missing pkt-30 both missing, pkt-31 send missing pkt-35 both missing, pkt-36 receive missing pkt-45 receive missing, pkt-46 receive missing pkt-55 receive missing, pkt-56 send missing pkt-65 send missing, pkt-66 send missing pkt-75 send missing, pkt-76 receive missing 100 packets, first 10 packets missing Any platform specific information?
Attempts to process received packets that weren't sent resulted in a KeyError exception in the examine_flow disruption calculation. This commit ignores them.
Description of PR
Summary:
Fixes # (issue)
Microsoft ADO: 27806353
Type of change
Back port request
Approach
What is the motivation for this PR?
The platform_tests.test_advanced_reboot.test_fast_reboot test was failing due to received packets that weren't sent.
How did you do it?
How did you verify/test it?
Modified the
examine_flowfunction to run independently then tested the logic with a series of pcap files with various missing packets in the sequence. The cases included:Any platform specific information?
Supported testbed topology if it's a new test case?
Documentation